<%--
  Created by IntelliJ IDEA.
  User: 13236
  Date: 2018/6/14
  Time: 14:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<script>
    function check() {
        alert("=====start======");

    }
    function fun1() {
        // alert("=======stop======");
        var xmlhttp;
        if (window.XMLHttpRequest){
            //IE7+ ,Firefox,Chrome Opera, Safari  浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }else {
            //IE6o ,IE5浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function () {
            if (xmlhttp.readyState==4 && xmlhttp.status==200){
                document.getElementById("show").innerHTML=xmlhttp.responseText;
            }

        }
        xmlhttp.open("GET","http://localhost:8080/javaweb_shopping/ajaxtestservlet",true);
        xmlhttp.send();
    }

</script>
    <button onclick="check()">请点击我</button><br>
    用户名：<input type="text" name="uname" id="uname" value="" onblur="fun1()">
<span id="show"></span>
</body>
</html>
